﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OracleClient;
public partial class basic_provider_add : System.Web.UI.Page
{ OracleConnection con = new OracleConnection("Data Source=orcl;Persist Security Info=True;User ID=booksale;Password=Qwertyuiop1;Unicode=True");
    protected void Page_Load(object sender, EventArgs e)
    {

    }
     protected void Button3_Click(object sender, EventArgs e)
        {

            string sql = "insert into booksale.supplier(供应商代码,供应商名称,联系电话,地址) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')";

            OracleCommand com = new OracleCommand(sql, con);

            if (con.State.Equals(ConnectionState.Closed))
            { con.Open(); }
            if (Convert.ToInt32(com.ExecuteNonQuery()) > 0)
            { Response.Write("<script language=javascript>alert('添加成功');</script>"); }
            else
            { Response.Write("<script language=javascript>alert('添加失败');</script>"); }
            if (con.State.Equals(ConnectionState.Open))
            { con.Close(); }
        }
     protected void Button4_Click(object sender, EventArgs e)
     {
         TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = " ";
     }
}